package com.probiz.estore.common.model.product.base;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.catalog.ProductCategory;
import com.probiz.estore.common.model.product.Product;
import com.probiz.estore.common.model.product.ProductAttGroup;
import com.probiz.estore.common.model.product.ProductRateItem;
import com.probiz.estore.common.model.product.ProductTypeBrand;
import com.probiz.estore.common.model.product.ProductTypeSkuOption;
import com.probiz.estore.common.model.system.TaxRate;
import com.probiz.estore.core.model.BaseObject;

/**
 * ProductType Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class ProductTypeTbl extends BaseObject implements Serializable {
	protected Integer productTypeId;
	protected String productTypeName;
	protected String productTypeDescription;
	protected String templatePath;
	protected Short kind;
	protected Integer version;
	protected String priceIntervals;

	protected Set<ProductAttGroup> productAttGroups = new HashSet<ProductAttGroup>();
	protected Set<Product> products = new HashSet<Product>();
	protected Set<ProductRateItem> productRateItems = new HashSet<ProductRateItem>();
	protected Set<ProductTypeSkuOption> productTypeSkuOptions = new HashSet<ProductTypeSkuOption> ();
	protected Set<ProductTypeBrand> productTypeBrands = new HashSet<ProductTypeBrand> ();
	protected Set<ProductCategory> productCategorys = new HashSet<ProductCategory> ();
	protected Set<TaxRate> taxRates = new HashSet<TaxRate> ();

	/**
	 * Default Empty Constructor for class ProductType
	 */
	public ProductTypeTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class ProductType
     * @param in_productTypeId 类型id
	 */
	public ProductTypeTbl (Integer in_productTypeId) {
        this.setProductTypeId(in_productTypeId);
    }


	public Set<ProductAttGroup> getProductAttGroups () {
		return productAttGroups;
	}	
	
	public void setProductAttGroups (Set<ProductAttGroup> in_productAttGroups) {
		this.productAttGroups = in_productAttGroups;
	}

	public Set<Product> getProducts () {
		return products;
	}	
	
	public void setProducts (Set<Product> in_products) {
		this.products = in_products;
	}

	public Set<ProductRateItem> getProductRateItems () {
		return productRateItems;
	}	
	
	public void setProductRateItems (Set<ProductRateItem> in_productRateItems) {
		this.productRateItems = in_productRateItems;
	}

	public Set<ProductTypeSkuOption> getProductTypeSkuOptions () {
		return productTypeSkuOptions;
	}	
	
	public void setProductTypeSkuOptions (Set<ProductTypeSkuOption> in_productTypeSkuOptions) {
		this.productTypeSkuOptions = in_productTypeSkuOptions;
	}

   

  

	public Set<ProductTypeBrand> getProductTypeBrands() {
		return productTypeBrands;
	}

	public void setProductTypeBrands(Set<ProductTypeBrand> productTypeBrands) {
		this.productTypeBrands = productTypeBrands;
	}

	public Set<ProductCategory> getProductCategorys() {
		return productCategorys;
	}

	public void setProductCategorys(Set<ProductCategory> productCategorys) {
		this.productCategorys = productCategorys;
	}
	
	public Set<TaxRate> getTaxRates() {
		return taxRates;
	}

	public void setTaxRates(Set<TaxRate> taxRates) {
		this.taxRates = taxRates;
	}

	/**
	 * 	 * @return Integer
     * @hibernate.id column="productTypeId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getProductTypeId() {
		return this.productTypeId;
	}
	
	/**
	 * Set the productTypeId
	 */	
	public void setProductTypeId(Integer aValue) {
		this.productTypeId = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="productTypeName" type="java.lang.String" length="32" not-null="true" unique="false"
	 */
	public String getProductTypeName() {
		return this.productTypeName;
	}
	
	/**
	 * Set the productTypeName
	 * @spring.validator type="required"
	 */	
	public void setProductTypeName(String aValue) {
		this.productTypeName = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="productTypeDescription" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getProductTypeDescription() {
		return this.productTypeDescription;
	}
	
	/**
	 * Set the productTypeDescription
	 */	
	public void setProductTypeDescription(String aValue) {
		this.productTypeDescription = aValue;
	}	

	/**
	 * 添加产品时前台产品默认显示模板	 * @return String
	 * @hibernate.property column="templatePath" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getTemplatePath() {
		return this.templatePath;
	}
	
	/**
	 * Set the templatePath
	 */	
	public void setTemplatePath(String aValue) {
		this.templatePath = aValue;
	}

    public Short getKind() {
        return kind;
    }

    public void setKind(Short kind) {
        this.kind = kind;
    }



	/**
	 * 	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	
	
	/**
	 * 	 * @return String
	 * @hibernate.property column="priceIntervals" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getPriceIntervals() {
		return this.priceIntervals;
	}
	
	/**
	 * Set the priceIntervals
	 */	
	public void setPriceIntervals(String aValue) {
		this.priceIntervals = aValue;
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof ProductTypeTbl)) {
			return false;
		}
		ProductTypeTbl rhs = (ProductTypeTbl) object;
		return new EqualsBuilder()
				.append(this.productTypeId, rhs.productTypeId)
				.append(this.productTypeName, rhs.productTypeName)
				.append(this.productTypeDescription, rhs.productTypeDescription)
				.append(this.templatePath, rhs.templatePath)
				.append(this.version, rhs.version)
				.append(this.priceIntervals, rhs.priceIntervals)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.productTypeId) 
				.append(this.productTypeName) 
				.append(this.productTypeDescription) 
				.append(this.templatePath) 
				.append(this.version)
				.append(this.priceIntervals) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("productTypeId", this.productTypeId) 
				.append("productTypeName", this.productTypeName) 
				.append("productTypeDescription", this.productTypeDescription) 
				.append("templatePath", this.templatePath) 
				.append("version", this.version) 
				.append("priceIntervals", this.priceIntervals) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "productTypeId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return productTypeId;
	}

}